﻿@model throneOfGames.Models.LobbyViewModel
@{
    ViewBag.Title = "Lobby";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section featured {
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1>@ViewBag.Title.</h1>
                <h2>@ViewBag.Message</h2>
            </hgroup>
        </div>
    </section>
}

<div id="site-container">
    <div id="game-chat">
        <h3>Chat</h3>
        @Html.Partial("_chat")
        @section Scripts
         {
            @Html.Partial("_ChatScript")
        }
    </div>

    <div id="settings">
        <h3>Settings</h3>
        @if (@Model.theGame.isPublic)
        {
            <p>Game type: Public</p>
        }
        else
        {
            <p>Game type: Private</p>
        }

        <p>Game ID: @Model.theGame.ID</p>
        <p>Max players: @Model.theGame.maxPlayersOfGame</p>
    </div>

    <div id="main-container">
        <h2>@Model.theGame.Boardgame.name</h2>
        @foreach (var p in Model.gamePlayers)
        {
            <p>Player @p.playerNumber: @p.User.userName</p>        
        }
        
        <p><a href="#">@Html.ActionLink("Start", "StartGame", "Game", new { id = @Model.theGame.ID }, new { @class = "startGame" })</a></p>
        <p><a href="#">@Html.ActionLink("Exit", "ExitGame", "Game", new { id = @User.Identity.Name, gameID = @Model.theGame.ID }, new { @class="exitGame" })</a></p>
    </div>
</div>
